package phoenix.web.test_suites.flirt.critical;

import org.testng.annotations.BeforeClass;
import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;

import phoenix.core.base.TestSuiteBase;
import phoenix.core.data_models.TestUserDataModel;
import phoenix.web.test_objects.PhotoGalleryTests;

/**
 * Created by AlexGolovko on 19.11.2014.
 */
public class PhotoGalleryTS extends TestSuiteBase
{
	private final PhotoGalleryTests galleryTests = new PhotoGalleryTests(phoenix);

	@DataProvider
	public Object[][] photosGallery()
	{
		return galleryTests.dataProviders.photosGallery();
	}

	@BeforeClass
	public void setUp()
	{
		TestUserDataModel p_user = db().getUserBy(testModel().getSiteName(), 1, "male");
		phoenix.backend().searchPage().verifyPayStatus(p_user);
		phoenix.setTestUser(p_user.getId());
	}

	@Test(priority = 1, dataProvider = "photosGallery", enabled = true)
	public void openGalleryTest(TestUserDataModel p_user, Integer p_photoNumber)
	{
		galleryTests.openGalleryTest(p_user);
	}

	@Test(dependsOnMethods = "openGalleryTest", priority = 2, dataProvider = "photosGallery", enabled = true)
	public void photosGalleryTest(TestUserDataModel p_user, Integer p_photoNumber)
	{
		galleryTests.photosGalleryTest(p_user, p_photoNumber);
	}

	@Test(dependsOnMethods = "openGalleryTest", priority = 3, dataProvider = "photosGallery", enabled = true)
	public void navigationGalleryTest(TestUserDataModel p_user, Integer p_photoNumber)
	{
		galleryTests.navigationGalleryTest(p_user);
	}
}